package demo2;

import java.util.Scanner;

public class Test {
    public static volatile int isQuit=0;
    public static void main(String[] args) {
        Thread t1=new Thread(()->{
            while(isQuit==0){
                //***不进行任何操作，死循环
            }
            System.out.println("t1进程结束");
        });
        Thread t2=new Thread(()->{
            System.out.println("请输入isQuit数值：");
            Scanner scanner = new Scanner(System.in);
            isQuit=scanner.nextInt();
        });
        t1.start();
        t2.start();
    }
}
